package com.itheima.domain.vo;

import cn.hutool.core.bean.BeanUtil;
import com.itheima.domain.db.UserInfo;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class SoundVo implements Serializable {

    private Integer id; // 当前用户id
    private String avatar; //发送语音用户头像
    private String nickname; //发送语音用户昵称
    private String gender; //性别
    private Integer age; //年龄
    private String soundUrl; //语音URL
    private Integer remainingTimes; //剩余次数

    // 设置用户信息
    public void setUserInfo(UserInfo userInfo) {
        if (userInfo != null) {
            BeanUtil.copyProperties(userInfo, this);
        }
    }
}